package org.leslie;

//import cn.itcast.pojo.Country;
import config.CommonConfig;
import config.CommonImportSelector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

@SpringBootApplication
// 手动扫描Configuration
// @Import({CommonConfig.class, CommonImportSelector.class})
public class SpringBootLeslieApplication {
    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(SpringBootLeslieApplication.class);

        // Code demo for 注册Bean
//        Country country = context.getBean(Country.class);
//        System.out.println(country);
        System.out.println(context.getBean("province"));

        // Code demo for 自动配置原理
        System.out.println(context.getBean("dispatcherServlet")); // org.springframework.web.servlet.DispatcherServlet@6056232d
    }
}